import http from "@/utils/request";

interface IResData<T>{
  code:string
  message:string
  data:T
}

//登录
function productTongjiRequest(){
  return http<IResData<number>>({
    method:'get',
    url:"/admin/statistic/product",
    data:{}
  })
}

function userTongjiRequest(){
  return http<IResData<number>>({
    method:'get',
    url:"/admin/statistic/user",
    data:{}
  })
}

interface IKData{
  x:Array<string>,
  val:Array<Array<number>>
}
interface ISimpleData{
  x:string
  val:number
}
function getkDataRequest(){
  return http<IResData<IKData>>({
    method:'get',
    url:"/admin/data/kData",
    data:{}
  })
}

function getsimpleDataRequest(){
  
  return http<IResData<Array<ISimpleData>>>({
    method:'get',
    url:"/admin/data/simpleData",
    data:{}
  })
}
export {productTongjiRequest,userTongjiRequest,getkDataRequest,getsimpleDataRequest}